class Solution {
public:
    vector<int> findIntersectionValues(vector<int>& nums1, vector<int>& nums2)
    {
        unordered_map<int, int> hash1;
        unordered_map<int, int> hash2;
        for (auto& a : nums1)
            hash1[a]++;
        for (auto& a : nums2)
            hash2[a]++;
        int cnt = 0;
        int cnt1 = 0;
        for (int i = 0; i < nums1.size(); i++)
        {
            if (hash2[nums1[i]] != 0)
                cnt++;
        }
        for (int i = 0; i < nums2.size(); i++)
        {
            if (hash1[nums2[i]] != 0)
                cnt1++;
        }
        vector<int> ans(2);
        ans[0] = cnt;
        ans[1] = cnt1;
        return ans;
    }
};